﻿using System.Web.Mvc;
using System.Web.Routing;

namespace MSAcademic.v2.Web
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute("Index", "", new { controller = "Home", action = "Index" }, new[] { "MSAcademic.v2.Web.Controllers" });

            routes.MapRoute("MicrosoftAndStudents", "microsoft-i-studenti", new { controller = "SimplePages", action = "Index" }, new[] { "MSAcademic.v2.Web.Controllers" });

            routes.MapRoute("Search", "pretraga", new { controller = "Search", action = "Search" }, new[] { "MSAcademic.v2.Web.Controllers" });
            routes.MapRoute("SearchViaUri", "pretrazi/{title}", new { controller = "Search", action = "SearchViaUri" }, new[] { "MSAcademic.v2.Web.Controllers" });

            routes.MapRoute("ViewAuthorProfile", "autor/{authorId}", new { controller = "Author", action = "ViewProfile" }, new[] { "MSAcademic.v2.Web.Controllers" });

            routes.MapRoute("NewsContentSection", "novosti", new {controller = "Home", action = "NewsContentSection"},
                            new[] {"MSAcademic.v2.Web.Controllers"});

            routes.MapRoute("ArticlesContentSection", "clanci",
                            new {controller = "Home", action = "ArticlesContentSection"},
                            new[] {"MSAcademic.v2.Web.Controllers"});
      
            routes.MapRoute("ArticleProfile", "novost/{articleId}/{articleTitle}",
                            new { controller = "Article", action = "ArticleProfile", articleTitle = UrlParameter.Optional }, new[] { "MSAcademic.v2.Web.Controllers" });

            routes.MapRoute("RssHome", "rss", new { controller = "Rss", action = "Home" });

            routes.MapRoute("Error", "{*url}", new { controller = "SimplePages", action = "ErrorPage" }, new[] { "MSAcademic.v2.Web.Controllers" });

        }
    }
}